package com.glory.good_dark.application;

import android.app.Application;
import android.content.Context;

import com.glory.good_dark.entity.UserEntity;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.cache.CacheMode;
import com.lzy.okgo.interceptor.HttpLoggingInterceptor;
import com.pda.platform.ui.ui_pdaplatform.base.FreeUI_InitUtils;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_SharePreferencesUtils;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_StaticMembers;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;

/**
 * @author yi.zhang
 * @date 2019/6/10
 * @desc
 */
public class App extends Application {
    public static Context app;
    private static App instance;
    public static String WEB_URL = "http://192.168.110.91:9861";
    public static String UPDATA_URL = "http://192.168.110.92:5000/PDAUpdate";
    public static int TIME_OUT;
    public static String EQPID = "";
    public static UserEntity userEntity;
    private static OkGo okGo;

    public static App getInstance() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        app = getApplicationContext();
        userEntity = new UserEntity();
        TIME_OUT = FreeApi_SharePreferencesUtils.getSharePreInt("GOODARK_FILE","TIME_OUT",App.app);
        if (TIME_OUT < 0){
            TIME_OUT = 60;
        }
//        FreeUI_InitUtils.init(getApplicationContext(), this, false);
        FreeUI_InitUtils.init(getApplicationContext(),this,true,TIME_OUT * 1000,0);
        FreeUI_InitUtils.setTheme(FreeApi_StaticMembers.THEME_GLORY);
    }
}
